home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / OpenGL 1.0 SDK / Headers / MUI / mui.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-18  |  5.7 KB  |  156 lines  |  [TEXT/CWIE]

  1. #ifndef __mui_h__
  2. #define __mui_h__
  3.  
  4. /*
  5.  * Copyright (c) 1993-1997, Silicon Graphics, Inc.
  6.  * ALL RIGHTS RESERVED 
  7.  * Permission to use, copy, modify, and distribute this software for 
  8.  * any purpose and without fee is hereby granted, provided that the above
  9.  * copyright notice appear in all copies and that both the copyright notice
  10.  * and this permission notice appear in supporting documentation, and that 
  11.  * the name of Silicon Graphics, Inc. not be used in advertising
  12.  * or publicity pertaining to distribution of the software without specific,
  13.  * written prior permission. 
  14.  *
  15.  * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
  16.  * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
  17.  * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
  18.  * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
  19.  * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
  20.  * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
  21.  * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
  22.  * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
  23.  * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
  24.  * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
  25.  * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
  26.  * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
  27.  * 
  28.  * US Government Users Restricted Rights 
  29.  * Use, duplication, or disclosure by the Government is subject to
  30.  * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
  31.  * (c)(1)(ii) of the Rights in Technical Data and Computer Software
  32.  * clause at DFARS 252.227-7013 and/or in similar or successor
  33.  * clauses in the FAR or the DOD or NASA FAR Supplement.
  34.  * Unpublished-- rights reserved under the copyright laws of the
  35.  * United States.  Contractor/manufacturer is Silicon Graphics,
  36.  * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
  37.  *
  38.  * OpenGL(R) is a registered trademark of Silicon Graphics, Inc.
  39.  */
  40.  
  41. #ifdef __cplusplus
  42. extern "C" {
  43. #endif
  44.  
  45. enum muiObjType { MUI_BUTTON, MUI_LABEL, MUI_BOLDLABEL, MUI_TEXTBOX, 
  46.           MUI_VSLIDER, MUI_TEXTLIST, MUI_RADIOBUTTON, 
  47.           MUI_TINYRADIOBUTTON, MUI_PULLDOWN, MUI_HSLIDER };
  48.  
  49. /* MUI Return Values: */
  50.  
  51. enum muiReturnValue { MUI_NO_ACTION,
  52.             MUI_SLIDER_MOVE,
  53.             MUI_SLIDER_RETURN,
  54.             MUI_SLIDER_SCROLLDOWN,
  55.             MUI_SLIDER_SCROLLUP, 
  56.             MUI_SLIDER_THUMB, 
  57.             MUI_BUTTON_PRESS,
  58.             MUI_TEXTBOX_RETURN,
  59.             MUI_TEXTLIST_RETURN,
  60.             MUI_TEXTLIST_RETURN_CONFIRM
  61. };
  62.  
  63. typedef struct muiobj {
  64.     enum muiObjType    type;
  65.     int    xmin, xmax, ymin, ymax;        /* bounding box */
  66.     short    active;        /* 1 = toggled on, or pressed radio button, or can
  67.                 be typed in (textbox), etc */
  68.     short    enable;        /* 1 = can be accessed; drawn with solid text */
  69.     short    select;        /* 1 = pressed (must be located at the time */
  70.     short    locate;        /* 1 = located; usually the cursor is over it */
  71.     short    visible;    /* 1 = drawn.  not visible => not enabled */
  72.     enum muiReturnValue        (*handler)(struct muiobj *obj, int event, int value, int x, int y);
  73.     int        id;        /* available for users */
  74.     int        uilist;
  75.     void *    object;
  76.     void    (*callback)(struct muiobj *, enum muiReturnValue);
  77. } muiObject;
  78.  
  79. /* General MUI Routines */
  80.  
  81. void        muiInit(void);
  82. void        muiNewUIList(int  listid);
  83. void        muiAddToUIList(int  uilist, muiObject *obj);
  84. void        muiSetCallback(muiObject *obj, void (*callback)(muiObject *, enum muiReturnValue));
  85. void        muiGetObjectSize(muiObject *obj, int *xmin, int *ymin, int *xmax, int *ymax);
  86. void        muiSetID(muiObject *obj, int id);
  87. int        muiGetID(muiObject *obj);
  88.  
  89. /* for a click that doesn't hit anything: */
  90.  
  91. void        muiSetNonMUIcallback(void (*nc)(int, int));
  92.  
  93. int        muiGetVisible(muiObject *obj);
  94. void        muiSetVisible(muiObject *obj, int state);
  95. int        muiGetActive(muiObject *obj);
  96. void        muiSetActive(muiObject *obj, int state);
  97. int        muiGetEnable(muiObject *obj);
  98. void        muiSetEnable(muiObject *obj, int state);
  99. void        muiSetActiveUIList(int i);
  100. int        muiGetActiveUIList(void);
  101.  
  102. /* Button Routines */
  103.  
  104. muiObject   *muiNewButton(int xmin, int xmax, int ymin, int ymax);
  105. void        muiLoadButton(muiObject *but, char *str);
  106. muiObject   *muiNewRadioButton(int xmin, int ymin);
  107. muiObject   *muiNewTinyRadioButton(int xmin, int ymin);
  108. void        muiLinkButtons(muiObject *obj1, muiObject *obj2);
  109. void        muiClearRadio(muiObject *rad);
  110.  
  111. /* Label Routines */
  112.  
  113. muiObject   *muiNewLabel(int xmin, int ymin, char *label);
  114. muiObject   *muiNewBoldLabel(int xmin, int ymin, char *label);
  115. void        muiChangeLabel(muiObject *obj, char *s);
  116.  
  117. /* Text Box Routines */
  118.  
  119. muiObject   *muiNewTextbox(int xmin, int xmax, int ymin);
  120. char        *muiGetTBString(muiObject *obj);
  121. void        muiClearTBString(muiObject *obj);
  122. void        muiSetTBString(muiObject *obj, char *s);
  123.  
  124. /* Vertical Slider Routines */
  125.  
  126. muiObject   *muiNewVSlider(int xmin, int ymin, int ymax, int scenter, int shalf);
  127. float        muiGetVSVal(muiObject *obj);
  128. void        muiSetVSValue(muiObject *obj, float val);
  129. void        muiSetVSArrowDelta(muiObject *obj, int newd);
  130.  
  131. /* Horizontal Slider Routines */
  132.  
  133. muiObject   *muiNewHSlider(int xmin, int ymin, int xmax, int scenter, int shalf);
  134. float        muiGetHSVal(muiObject *obj);
  135. void        muiSetHSValue(muiObject *obj, float val);
  136. void        muiSetHSArrowDelta(muiObject *obj, int newd);
  137.  
  138. /* Text List Routines */
  139.  
  140. muiObject   *muiNewTextList(int xmin, int ymin, int xmax, int listheight);
  141. void        muiSetTLTop(muiObject *obj, float p);
  142. int        muiGetTLSelectedItem(muiObject *obj);
  143. void        muiSetTLStrings(muiObject *obj, char **s);
  144. void        muiSetTLTopInt(muiObject *obj, int top);
  145.  
  146. /* Pulldown Menu Routines */
  147.  
  148. muiObject   *muiNewPulldown(void);
  149. void        muiAddPulldownEntry(muiObject *obj, char *title, int menu, int ishelp);
  150.  
  151. #ifdef __cplusplus
  152. }
  153.  
  154. #endif
  155. #endif /* __mui_h__ */
  156.